package org.crc.myvhrb.service;

import org.crc.myvhrb.mapper.PositionMapper;
import org.crc.myvhrb.model.Position;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * CRC
 * 2021/8/6
 */
@Service
public class PositionService {

    @Autowired
    PositionMapper positionMapper;

    public List<Position> getAllPosition() {
        return positionMapper.getAllPosition();
    }

    public int insertSelective(Position position) {
        position.setEnabled(true);
        position.setCreateDate(new Date());
        return positionMapper.insertSelective(position);
    }

    public int deleteByPrimaryKey(int id) {
        return positionMapper.deleteByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(Position position) {
        return positionMapper.updateByPrimaryKeySelective(position);
    }

    public int deletePositionByIds(Integer[] ids) {
        return positionMapper.deletePositionByIds(ids);
    }
}
